
riot.tag2('comail-template', '<div class="container"> <ul> <li> <a href="javascript:;" onclick="{fn.onecol}">创建单列模版</a> </li> </ul> </div>', '', '', function(opts) {
    var tag = this;
    tag.defaultStyle = {
      padding: {
        t: 10, r: 10, b: 10, l: 10
      },
      margin: {
        t: 0, r: 0, b: 0, l: 0
      }
    };
    tag.fn = {
      onecol: function(){
        tag.app.api('POST', 'mail_manage/update_template', {
          template_id: 70,
          cid: 1,
          name: '单列布局',
          img_path: 'http://pics.sosho.cn/FmKcw12sw9l-9wcrat-qLZU6QonI',
          layout: 'onecol',
          modules: JSON.stringify([
            {
              name: 'header',
              styles: tag.defaultStyle,
              items: []
            }, {
              name: 'body',
              styles: tag.defaultStyle,
              items: []
            }, {
              name: 'footer',
              styles: tag.defaultStyle,
              items: []
            }
          ]),
          html: '<html/>'
        })
      }
    };
    tag.on('mount', function(){

    });
});
